import { defineStore } from 'pinia'
export const useTabsStore = defineStore('navtabs', {
  state: () => ({
    tabs: [
      {
        path: '/home/dashboard',
        title: 'dashboard'
      },
      {
        path: '/about/list',
        title: 'list'
      }
    ]
  }),
  actions: {
    // 增删查
    addTab(tab) {
      const { path } = tab
      const flag = this.tabs.some((item) => item.path === path)
      if (flag) return
      this.tabs.push(tab)
    }
  }
})
